<extend name="Public:form_layout" />
<block name="subheader">
    <script language="javascript" type="text/javascript" src="__PUBLIC__/js/admin/content_add.js" charset="UTF-8"></script>
    <script type="text/javascript" src="__PUBLIC__/js/admin/attachupload.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/ckeditor/ckeditor.js"></script>
</block>
<block name="main">
    <form name="myform" id="myform" action="" method="post" enctype="multipart/form-data">
        <input type="hidden" name="id" value="<?php echo $content['id']; ?>" />
        <input type="hidden" name="moduleid" value="<?php echo $module['id']; ?>">
        <div class="common-form">
            <table width="100%" cellspacing="0" class="table_form">
                <tbody>
                    <?php
                    if(is_array($forminfos)) {
                        foreach($forminfos as $field=>$info) {
                            if($info['isomnipotent']) continue;
                            if($info['formtype']=='omnipotent') {
                                foreach($forminfos as $_fm=>$_fm_value) {
                                    if($_fm_value['isomnipotent']) {
                                        $info['form'] = str_replace('{'.$_fm.'}',$_fm_value['form'],$info['form']);
                                    }
                                }
                            }
                            ?>
                            <tr>
                                <th width="80"><?php if($info['star']){ ?> <font color="red">*</font><?php } ?> <?php echo $info['name']?>
                                </th>
                                <td><?php echo $info['form']?>  <?php echo $info['tips']?></td>
                            </tr>
                            <?php
                        }
                    }
                    ?>
                    <?php if($_SESSION['user_info']['role_id']==1) { ?>
                        <th>状态</th>
                        <td>
                            <label><input type="radio" name="info[status]" value="99" checked/> 发布 </label>
                            <label><input type="radio" name="info[status]" value="1" > 审核 </label>
                        </td>
                    <?php } ?>
                </tbody>
            </table>
        </div>
        <div class="bk15"></div>
        <input name="dosubmit" type="submit" class="button" value="提交">
    </form>
</block>
<block name="footer">
    <script type="text/javascript">
        $(function(){
            $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({id:'check_content_id',content:msg,lock:true,width:'200',height:'50'},   function(){$(obj).focus();
                boxid = $(obj).attr('id');
                if($('#'+boxid).attr('boxid')!=undefined) {
                    check_content(boxid);
                }
            })}});
            <?php echo $formValidator;?>
        });
    </script>
</block>